package com.mccrea.pattern.composite;

/**
 * @Classname Client
 * @Description 组合模式测试
 * @Date 2021/5/10 0010 10:22
 * @Created by Mccrea_Gao
 */
public class Client {
    public static void main(String[] args) {
        OrganizationComponent university = new University("华中科技大学", "武汉");
        OrganizationComponent college1 = new College("船舶与海洋工程学院", "造船");
        OrganizationComponent college2 = new College("机械学院", "造钢铁");
        college1.add(new Department("船舶与海洋", "造船"));
        college1.add(new Department("轮机工程", "发动机"));
        college2.add(new Department("机械制造", "造钢铁"));
        college2.add(new Department("机械工艺", "工艺设计"));
        university.add(college1);
        university.add(college2);
        university.print();
    }
}
